﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Mail;

namespace Sabnzbd
{
    public class szdEmail
    {

        public SmtpClient getSmtpClient()
        {
            if (!Server.Equals(""))
            {
                SmtpClient _SC = new SmtpClient();

                string[] server = this.Server.Split(':');
                _SC.Host = server[0];
                if (server.Count() == 2)
                {
                    _SC.Port = Convert.ToInt32(server[1]);
                }

                return _SC;
            }
            else
            {
                throw new Exception("Email server property isn't correctly configured in sabnzbd");
            }
        }

        private string m_From;

        public string From
        {
            get { return m_From; }
            set { m_From = value; }
        }
        private string m_To;

        public string To
        {
            get { return m_To; }
            set { m_To = value; }
        }
        private string m_Server;

        public string Server
        {
            get { return m_Server; }
            set { m_Server = value; }
        }
        private string m_AccountName;

        public string AccountName
        {
            get { return m_AccountName; }
            set { m_AccountName = value; }
        }
        private string m_Password;

        public string Password
        {
            get { return m_Password; }
            set { m_Password = value; }
        }
        private bool m_EmailAtEndOfJob;

        public bool EmailAtEndOfJob
        {
            get { return m_EmailAtEndOfJob; }
            set { m_EmailAtEndOfJob = value; }
        }
        private bool m_EmailAtDiskFull;

        public bool EmailAtDiskFull
        {
            get { return m_EmailAtDiskFull; }
            set { m_EmailAtDiskFull = value; }
        }
    }
}
